CREATE TABLE [dbo].[DnnProduct_CDS_DistributorBillingConfig]
(
[ID] [int] NOT NULL IDENTITY(1, 1),
[DistributorID] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[BillingConfigID] [int] NOT NULL,
[BillingStartDate] [datetime] NOT NULL,
[TrialAccount] [bit] NOT NULL,
[TrialAccountDate] [datetime] NULL,
[ContractDate] [datetime] NULL,
[ServiceStatement] [int] NOT NULL,
[AcumenID] [int] NULL,
[CurrencyID] [int] NULL,
[ExchangeRate] [decimal] (12, 4) NULL,
[Enabled] [bit] NOT NULL CONSTRAINT [DF__DnnProduc__Enabl__4F52B2DB] DEFAULT ((1))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DnnProduct_CDS_DistributorBillingConfig] ADD CONSTRAINT [PK_DnnProduct_CDS_DistributorBillingConfig] PRIMARY KEY CLUSTERED  ([ID]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [UIX_DnnProduct_CDS_DistributorBillingConfig_DistributorID] ON [dbo].[DnnProduct_CDS_DistributorBillingConfig] ([DistributorID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DnnProduct_CDS_DistributorBillingConfig] ADD CONSTRAINT [FK_DnnProduct_CDS_DistributorBillingConfig_DnnProduct_CDS_BillingConfig] FOREIGN KEY ([BillingConfigID]) REFERENCES [dbo].[DnnProduct_CDS_BillingConfig] ([ID])
GO
